package orm

import (
	"xkginweb/global"
	"xkginweb/model/entity/basis"
	"xkginweb/model/entity/coolingPool"
	"xkginweb/model/entity/coolingPoolDevice"
	"xkginweb/model/entity/importantDevice"
	"xkginweb/model/entity/importantPort"
	"xkginweb/model/entity/jwt"
	"xkginweb/model/entity/report"
	"xkginweb/model/entity/reportDetail"
	"xkginweb/model/entity/reporter"
	"xkginweb/model/entity/room"
	sys2 "xkginweb/model/entity/sys"
)

func RegisterTable() {
	db := global.KSD_DB
	// 注册和声明model
	// 系统用户，角色，权限表
	db.AutoMigrate(sys2.SysApis{})
	db.AutoMigrate(sys2.SysMenus{})
	db.AutoMigrate(sys2.SysRoleApis{})
	db.AutoMigrate(sys2.SysRoleMenus{})
	db.AutoMigrate(sys2.SysRoles{})
	db.AutoMigrate(sys2.SysUserRoles{})
	db.AutoMigrate(sys2.SysUser{})

	// 房间
	db.AutoMigrate(room.QccRoom{})
	// 冷池
	db.AutoMigrate(coolingPool.QccCoolingPool{})
	// 冷池检测项
	db.AutoMigrate(coolingPoolDevice.QccCoolingPoolDevice{})
	// 重要设备
	db.AutoMigrate(importantDevice.QccImportantDevice{})
	// 基础检查项
	db.AutoMigrate(basis.QccBasis{})
	// 重要端口
	db.AutoMigrate(importantPort.QccImportantPort{})
	// 上报情况
	db.AutoMigrate(report.QccReport{})
	// 上报详情
	db.AutoMigrate(reportDetail.QccReportDetail{})
	// 保修人员表
	db.AutoMigrate(reporter.QccReporter{})

	// 声明一下jwt模型
	db.AutoMigrate(jwt.JwtBlacklist{})
}
